package com.ruoyi.categories.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.categories.mapper.TbDishCategoriesMapper;
import com.ruoyi.categories.domain.TbDishCategories;
import com.ruoyi.categories.service.ITbDishCategoriesService;

/**
 * 菜品类别Service业务层处理
 * 
 * @author txt
 * @date 2025-02-05
 */
@Service
public class TbDishCategoriesServiceImpl implements ITbDishCategoriesService 
{
    @Autowired
    private TbDishCategoriesMapper tbDishCategoriesMapper;

    /**
     * 查询菜品类别
     * 
     * @param categoryId 菜品类别主键
     * @return 菜品类别
     */
    @Override
    public TbDishCategories selectTbDishCategoriesByCategoryId(Long categoryId)
    {
        return tbDishCategoriesMapper.selectTbDishCategoriesByCategoryId(categoryId);
    }

    /**
     * 查询菜品类别列表
     * 
     * @param tbDishCategories 菜品类别
     * @return 菜品类别
     */
    @Override
    public List<TbDishCategories> selectTbDishCategoriesList(TbDishCategories tbDishCategories)
    {
        return tbDishCategoriesMapper.selectTbDishCategoriesList(tbDishCategories);
    }

    /**
     * 新增菜品类别
     * 
     * @param tbDishCategories 菜品类别
     * @return 结果
     */
    @Override
    public int insertTbDishCategories(TbDishCategories tbDishCategories)
    {
        return tbDishCategoriesMapper.insertTbDishCategories(tbDishCategories);
    }

    /**
     * 修改菜品类别
     * 
     * @param tbDishCategories 菜品类别
     * @return 结果
     */
    @Override
    public int updateTbDishCategories(TbDishCategories tbDishCategories)
    {
        return tbDishCategoriesMapper.updateTbDishCategories(tbDishCategories);
    }

    /**
     * 批量删除菜品类别
     * 
     * @param categoryIds 需要删除的菜品类别主键
     * @return 结果
     */
    @Override
    public int deleteTbDishCategoriesByCategoryIds(Long[] categoryIds)
    {
        return tbDishCategoriesMapper.deleteTbDishCategoriesByCategoryIds(categoryIds);
    }

    /**
     * 删除菜品类别信息
     * 
     * @param categoryId 菜品类别主键
     * @return 结果
     */
    @Override
    public int deleteTbDishCategoriesByCategoryId(Long categoryId)
    {
        return tbDishCategoriesMapper.deleteTbDishCategoriesByCategoryId(categoryId);
    }
}
